<%= javascript_include_tag "story_show" %> 

<%= render :partial => "nav_bar" %>
<%= render :partial => "layouts/top_stories" %>

<div class="left_articles">

<h2>
  <%=h @story.title %> [<%=h @story.typ %> Rating: <%= @story.story_rating %>]
</h2>
<p>created by <%= link_to @story.user.login, user_path(@story.user) %> on <%= @story.created_at.strftime('%m/%d/%Y at %I:%M%p') %> | <%= link_to 'edit story details', edit_story_path(@story) %> </p>

<p class="story_summary">
<%=h @story.summary %>
</p>

<p>
<b>Tags</b>:
<% if @tags.nil? || @tags.empty? %>
   No tags associated with this story. 
<% else %>
  <% @tags.each do |t| %>
    <%= link_to t.name, tag_url(t) %>
  <% end %>
<% end %>
<%= link_to '[add tags]', edit_story_url(@story) %>
</p>

<div id="star-ratings-block">
    <%= render :partial => "rating/rating", :locals => { :story => @story } %>
</div>

</div>
<div class="left_box">

<div align=right>
<table width=100%>
<tr><td align=left>
<%= link_to_remote("Show Earlier Lines", :update=>"earlier_lines", :url=>{:action=> :fetch_earlier, :story_id=>@story.id }, :complete=>visual_effect("slide_down", "earlier_lines") ) %></td>
<td align=right><img src="/images/print.gif"> <%= link_to 'Print View', :action=>:print, :id=>@story.id %></td>
</tr>
</table>
</div>

<div id="earlier_lines"> </div>
<div id="lines">
	<%= render :partial => "lines" %>
</div>

<% if !@line.nil? %>
<% form_for([@story, @line]) do |f| %>
  <%= f.error_messages %>
  <p>
    <%= f.label "Line (the max length is #{@story.max_line_length} characters)" %><br />
    <%= f.text_area :line %>
  </p>
  <p>
    <%= f.submit "Create" %>
  </p>
<% end %>
<% end %>

</div>

<%= link_to '<< Back to Story Listing', stories_path %>
</div>
<%= render :partial => "layouts/right_bar" %>